/*
vision.h
offer vision comunication api 
designed by lunanting

------------------------
2020-08-10 20:36:44
create file
------------------------
*/
#ifndef __VISION_H
#define __VISION_H

#include "../../bsp/base_type.h"
#include "../../../include/aos/hal/uart.h"
#include "../../../include/aos/kernel.h"

/**********************need redefine API*************************/
extern void xp_vision_recive_deal(char *str);    //vision board data deal with


/*********************date type define***********************/
//vision class
typedef struct{
    u8 init;        //init state
    aos_sem_t sem;  //print sem
    uart_dev_t uart;    //uart
}VISION_class;


#define XP_MESSAGE_RECV_BUFF_SIZE   (140)

/**********************************function extern**********************/
extern char* xp_vision_split_message(char*rec,char*bufout);
extern int xp_vision_init(u8 port,int speed);   //init vision module
extern int xp_vision_println(const char *str,...);  //vision uart send
extern void xp_vision_send(char *data,int len);     //vision send data
extern int xp_vision_cmd(char *cmd,char *param);    //vision send cmd
extern int xp_vision_debug(char *type,char *fun,char *param);   //vision debug




#endif
//end of the file
